import { createRouter, createWebHashHistory } from 'vue-router';  
import Home from '../views/Home.vue';  
import Products from '../views/Products.vue';  
import Cart from '../views/Cart.vue';  
import Users from '../views/Users.vue';  

  
const routes = [  
  {  
    path: '/',  
    name: 'home',  
    component: Home  
  },  
  {  
    path: '/products',  
    name: 'products',  
    component: Products  
  },  
  {  
    path: '/cart',  
    name: 'cart',  
    component: Cart  
  },  
  {  
    path: '/users',  
    name: 'users',  
    component: Users  
  },  
  {  
    path: '/add',  
    name: 'add',  
    component: ()=>import ('../views/AddProduct.vue')
  },  
  // 可以添加更多路由  
];  
  
const router = createRouter({  
  history: createWebHashHistory(),  
  routes  
});  
  
export default router;